import React, { PureComponent } from 'react';
import { WriterWrapper, ProjectContainer, ProjectItem} from '../style';
import { connect } from 'react-redux'
import { Icon } from 'antd';

class Writer extends PureComponent {
	constructor(props) {
    super(props);
	}
	
	render() {
		return (
			<WriterWrapper>
					{
            this.props.list.map((item)=> {
              return (
                <ProjectContainer key={item.get('id')} to='project'>
                  <ProjectItem>{item.get('name')}<Icon type="right" /></ProjectItem>
                </ProjectContainer>
              )
            })
            
          }
				
			</WriterWrapper>
		)
	}
}

const mapState = (state) => ({
	list: state.getIn(['home', 'projectList'])
});

export default connect(mapState, null)(Writer);
